package org.gpslw.controller;

import org.geotools.api.feature.simple.SimpleFeature;
import org.gpslw.util.GpkgReader;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/gpkg")
public class GkpkController {

    @GetMapping("/list")
    public Map<String, List<SimpleFeature>> gkpk(@RequestParam("gpkgPath")String gpkgPath) throws IOException {
        return GpkgReader.readGpkgFile(gpkgPath);
    }
}
